﻿#region  Copyright (C) 2013 Unisys Corporation

// =============================================================================================
// All Rights Reserved. This work contains trade secrets and confidential material of UNISYS, 
// and its use or disclosure in whole or in part without explicit written permission of 
// UNISYS is prohibited. 
//  
// Product Name          :  Unisys e-Workflow and Imaging
// File Name             :  Configuration.cs
// Authored By           :  Unisys Corporation
// =============================================================================================
//	Modified by                         Date            Version
// =============================================================================================
//	ronald.aguilar@cr.unisys.com      May 01, 2013    Initial Version
// =============================================================================================
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Diagnostics;

namespace Entidades
{

    public static class Configuration
    {

        public static string logLocation;
        public static int logMaxSizeBytes;
        public static string IIFDomain;
        public static string IIFUser;
        public static string IIFPassword;
        public static string inputQueue;
        public static string stringConnection;
        public static string outputQueue;
        public static string systemID;

        public static string readCommand;
        public static string readCommandParameter;

        public static string updateCommand;
        public static string updateIDParameter;
        public static string updateVersionParameter;
        public static string updateHistoricoParameter;

        public static string[] searchQueues;
        public static string[] emailAccountTo;
        public static string duplicateRules;
        public static string topQuery;
        public static int beginTime;
        public static int endTime;


        public static bool Information_Message;
        public static bool Error_Message;
        public static bool Log_Message;
        public static bool Process_Message;
        public static bool FileSystemLog; 

        public static void Load()
        {           
            //Configuration appConfig = new Configuration();

            
            Configuration.logLocation = ConfigurationManager.AppSettings["logLocation"].ToString();

            
            Configuration.logMaxSizeBytes = Convert.ToInt32(ConfigurationManager.AppSettings["logMaxSizeBytes"].ToString());


            
            Configuration.IIFDomain = ConfigurationManager.AppSettings["IIFDomain"].ToString();

            
            Configuration.IIFUser = ConfigurationManager.AppSettings["IIFUser"].ToString();

            
            Configuration.IIFPassword = ConfigurationManager.AppSettings["IIFPassword"].ToString();

            
            Configuration.inputQueue = ConfigurationManager.AppSettings["inputQueue"].ToString();

            
            Configuration.stringConnection = ConfigurationManager.AppSettings["stringConnection"].ToString();

            
            Configuration.systemID = ConfigurationManager.AppSettings["systemID"].ToString();

            
            Configuration.readCommand = ConfigurationManager.AppSettings["readCommand"].ToString();

            Configuration.readCommandParameter = ConfigurationManager.AppSettings["readCommandParameter"].ToString();
            
            Configuration.updateCommand = ConfigurationManager.AppSettings["updateCommand"].ToString();

            Configuration.updateHistoricoParameter = ConfigurationManager.AppSettings["updateCommandHistoricoParameter"].ToString();

            Configuration.updateIDParameter = ConfigurationManager.AppSettings["updateCommandIDParameter"].ToString();

            Configuration.updateVersionParameter = ConfigurationManager.AppSettings["updateCommandVersionParameter"].ToString();

            Configuration.searchQueues = ConfigurationManager.AppSettings["searchQueues"].ToString().Split(',');

            
            Configuration.emailAccountTo = ConfigurationManager.AppSettings["emailAccountTo"].ToString().Split(',');

            
            Configuration.duplicateRules = ConfigurationManager.AppSettings["duplicateRules"].ToString();

            
            Configuration.outputQueue = ConfigurationManager.AppSettings["outputQueue"].ToString();

            
            Configuration.topQuery = ConfigurationManager.AppSettings["topQuery"].ToString();

            
            Configuration.beginTime = Convert.ToInt32(ConfigurationManager.AppSettings["beginTime"].ToString());

            
            Configuration.endTime = Convert.ToInt32(ConfigurationManager.AppSettings["endTime"].ToString());

            //llaves de bitacora
            
            Configuration.Information_Message = Boolean.Parse(ConfigurationManager.AppSettings["Information_Message"].ToString());
            
            Configuration.Error_Message = Boolean.Parse(ConfigurationManager.AppSettings["Error_Message"].ToString());
            
            Configuration.Log_Message = Boolean.Parse(ConfigurationManager.AppSettings["Log_Message"].ToString());
            
            Configuration.Process_Message = Boolean.Parse(ConfigurationManager.AppSettings["Process_Message"].ToString());
            
            Configuration.FileSystemLog = Boolean.Parse(ConfigurationManager.AppSettings["FileSystemLog"].ToString());
        }

     
    }
}
